# Uncomment the next line to define a global platform for your project
# ①. load Flutter podhelper
flutter_application_path = '../my_flutter'
load File.join(flutter_application_path, '.ios', 'Flutter', 'podhelper.rb')

platform :ios, '11.0'

inhibit_all_warnings!

workspace 'uniPluginFlutter'

# pre_install do |installer|
#   # workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
#   Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
# end

post_install do |installer|
  
#  ②. flutter post_install
  flutter_post_install(installer) if defined?(flutter_post_install)
  
  installer.pods_project.build_configurations.each do |configuration|
    configuration.build_settings.delete 'ONLY_ACTIVE_ARCH'
  end
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['ARCHS'] = '$(ARCHS_STANDARD)'
    end
  end
end

target 'uniPluginFlutter' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

#  ③. install flutter pods
  install_all_flutter_pods(flutter_application_path)

  # Pods for uniPlugin
  pod 'sn_flutter', :path =>'./sn_flutter'

end
